package com.itheima.多线程.基础;

public class Demo4 extends Thread {
    @Override
    public void run() {
        for (int i = 0; i < 100; i++) {
            System.out.println(getName() + "" + i);
//            System.out.println(Thread.currentThread().getName()+""+i);
        }
    }

    public Demo4(String name) {
        super(name);
    }

    public Demo4() {

    }
}

class Test4 {
    public static void main(String[] args) {
        Demo4 demo = new Demo4("小陈");
        demo.start();
        Thread th = new Thread(demo, "小强");
        th.setName("小丽");
        th.start();
        System.out.println(th.getName());
    }
}